<template>
	<div class="table-data">
		<ve-table :data="tableData" :table-row-class-name="tableRowClassName" stripe>
			<ve-table-column prop="name" label="系列课名称" width="300" />
			<el-table-column prop="teachRange" label="教学阶段">
				<!-- <template slot-scope="scope">{{ Dictionary.get(teachRange)[scope.row.teachRange] }}</template> -->
				<template slot-scope="scope">{{ scope.row.teachRange|veDict('teachRange') }}</template>
			</el-table-column>
			<ve-table-column prop="projectName" label="项目" />
			<ve-table-column prop="updateUserName" label="修改人" />
			<ve-table-column prop="updateTime" label="修改时间" />
			<ve-table-column prop="createUserName" label="创建人" />
			<ve-table-column prop="createTime" label="创建时间" />
			<el-table-column label="操作">
				<template slot-scope="scope">
					<el-link
						type="primary"
						:underline="false"
						@click="showDetail(scope.row)"
						style="margin-right:10px"
					>
						查看
					</el-link>
					<el-link
						type="primary"
						:underline="false"
						@click="editDetail(scope.row)"
						v-permiss-code="'rc/tag/course-edit'"
					>
						修改
					</el-link>
				</template>
			</el-table-column>
		</ve-table>
		<ve-pagination :get-page="getPage" :page.sync="page" />
	</div>
</template>

<script>
	export default {
		name: "table-data",
		props: {
			tableData: {
				type: Array,
				default: () => []
			},
			page: {
				type: Object,
				default: () => {}
			}
		},
		methods: {
			tableRowClassName({ rowIndex }) {
				if (rowIndex === 1) {
					return "danger-bg-color";
				}
				return "";
			},

			showDetail(row) {
				this.$emit("item-detail-info", row);
			},
			editDetail(row) {
				this.$emit("edit-item-detail", row);
			},
			getPage() {
				this.$emit("get-course-page", this.page);
			}
		}
	};
</script>

<style>
</style>
